An accelerometer is a device that typically measures the acceleration experienced relative to freefall. Single- and multi-axis accelerometers are available to detect magnitude and direction of the acceleration as a vector quantity, and can be used to sense orientation, acceleration, vibration, shock, and falling. Micromachined accelerometers are increasingly present in portable electronic devices and video game controllers to detect the position of the device and/or provide for game input. Such accelerometers may be packaged in an integrated circuit device which may also include conditioning circuitry. Various sources of error in an accelerometer typically call for calibration before use. One of the leading sources of error in an accelerometer is attributed to the 0 g-offset or bias error. The 0 g-offset is defined as the difference between the measured value of the sensor from the true zero value. The 0 g-offset value is commonly subtracted when taking acceleration measurements. Accelerometers are typically calibrated by the semiconductor manufacturer prior to their installation into another device. For example, accelerometers are “trimmed” for 0 g-offset and sensitivity by adjusting the offset trim codes and gain (if the trimming is done using digitally-stored trim codes and a digital to analog converter). Other (analog) trim methods are also known. Many semiconductor devices incorporate a digital trim circuit, which can be used to adjust a device's operating voltages following manufacture. The programming of a trim circuit can be performed in accordance with trim codes, which comprise information corresponding to different adjustment values. A trim circuit is typically programmed by calibrating trim codes during a test operation. The test operation is typically performed by a dedicated test apparatus. In a conventional test operation, the test apparatus applies various signals to the device according to the trim codes and calibrates the trim codes according to the device's responses to the signals. Following the test operation, the calibrated trim codes are programmed into the device. US 2011110164 A1 describes an example of a trim circuit incorporated in a memory device. Even though accelerometers are calibrated by the semiconductor manufacturer, they can lose their calibration during use. For example, when the accelerometers are mounted onto a printed circuit board, various mechanical strains are produced. Such conditions can cause further 0 g-offset shifts. US 20120215477 A1 describes an accelerometer having an autocalibration function which permits the accelerometer to be re-calibrated over time.